﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LynxWiki.Repository;
using System.Web.Hosting;
using LynxWiki.DomainModel;

namespace IronWiki
{
    [Description("A class that provides access to wiki topic data")]
    public class WikiDirectory
    {
        private string wikiPath;
        private WikiDirectoryRepository wdr;

        [Description("A class initializer that provides access to wiki directory data")]
        public WikiDirectory(string wikiPath)
        {
            this.wikiPath = wikiPath;
            wdr = new WikiDirectoryRepository(Path.Combine(ConfigurationManager.AppSettings["HostWikiPath"], wikiPath.Replace("/", "\\")), null);
        }

        [Description(@"Returns a list of ""FileInfo"" for the directory")]
        public List<FileInfo> GetDirectoryFileInfos()
        {
            return wdr.GetWikiTopicFileInfoList();
        }


    }
}
